import type { BasicFetchResult, BasicPageParams, BasicRecord } from './baseModel';

export type SpColumnRecord = BasicRecord & {
  /** @Column({ comment: '专栏名称' }) */
  name: string;
  /** @Column({ comment: '简介' }) */
  desc: string;
  /** @Column({ comment: '封面', nullable:true} }) */
  cover: string;
  /** @Column({ comment: '订阅数', default:0 }) */
  subscribe_num: number;
  /** @Column({ comment: '文章数量', default:0 }) */
  article_num: number;
  /** @Column({ comment: '用户id' }) */
  user_id: number;
  /** @Column({ comment: '栏目id' }) */
  column_id: number;
  user_icon: string;
  user_name: string;
  is_subscribe: boolean | undefined;
  top5: [];
  spUserCount: number;
};

export type SpColumnInfoModel = SpColumnRecord;

export interface SpColumnInfoParams {
  id: number;
  user_id: number | null;
}

export interface SpColumnFollowParams {
  page: number;
  size: number;
}

export type SpColumnPageParams = BasicPageParams & {};
export type SpColumnPageResultModel = BasicFetchResult<SpColumnRecord>;

export type SpColumnListParams = Pick<SpColumnRecord, 'name'>;

export type SpColumnListResultModel = SpColumnRecord[];

export type AddSpColumnParams = Pick<SpColumnRecord, 'name' | 'desc' | 'cover' | 'column_id'>;
export type AddSpColumnResultModel = SpColumnRecord;
